<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%String path = request.getContextPath();%>
<%@ taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>绩效报表</title>
    <style type="text/css">
    </style>
    <jsp:include page="../../import.jsp" flush="true"/>
</head>

<body class="iframeBody">
<div class="Wrapper">
    <div class="searchArea">
        <form id="searchBar">
            <div class="fieldset1 clearFix">
                <div class="fieldBox">
                    <div class="label">事业部</div>
                    <div class="field">
                        <input name="buOrgCd" id="buOrgCd" placeholder="请选择" ltype="combobox">
                    </div>
                </div>

                <div class="fieldBox">
                    <div class="label">逾期天数</div>
                    <div class="field">
                        <input ligerui="width: 82" name="ovdDaysMin" id="ovdDaysMin" type="text" class="ui-textbox"
                               value="" validate="{number:true}">
                        -
                        <input ligerui="width: 82" name="ovdDaysMax" id="ovdDaysMax" type="text" class="ui-textbox"
                               value="" validate="{number:true}">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">时间段</div>
                    <div class="field">
                        <input ligerui="width: 90" name="ovdDtMin" id="ovdDtMin" type="text" class="ui-datepicker"
                               value="" validate="{required:true}">
                        -
                        <input ligerui="width: 90" name="ovdDtMax" id="ovdDtMax" type="text" class="ui-datepicker"
                               value="" validate="{required:true}">
                    </div>
                </div>
                <div class="fieldBox">
                    <div class="label">责任人</div>
                    <div class="field">
                        <input name="collectUsrNm" id="collectUsrNm" type="text" class="ui-textbox" value="">
                    </div>
                </div>

                <div class="formBtns notRight">
                    <span id="searchBtn" class="sq-button sq-button-round">查询</span>
                    <span id="clearBtn" class="sq-button sq-button-round">清空</span>
                    <input id="resetBtn" type="reset" value="重置" class="l-button l-button-reset Hide"/>
                </div>
                <div class="clearFix"></div>
            </div>
        </form>
    </div>

    <div id="ligergrid1" class="sq-grid"></div>
</div>

<script type="text/javascript">
    var grid = null, form = null;
    $(function () {
        grid = $("#ligergrid1").ligerGrid({
            url: '<%=path%>/risk/collectReport/initPerformanceList.do',
            method: 'get',
            columns: [
                {
                    display: '逾期金额', name: '', minWidth: 100, align: 'center', enabledSort: false,
                    render: function (rowdata, index, value) {
                        return '&yen;' + FormatMoney((rowdata.overdueAmount+rowdata.penaltyAmount)/100);
                    }
                },
                {
                    display: '逾期租金', name: 'overdueAmount', minWidth: 100, align: 'center', enabledSort: false,
                    render: function (rowdata, index, value) {
                        return '&yen;' + FormatMoney(rowdata.overdueAmount / 100);
                    }
                },
                {
                    display: '罚息', name: 'penaltyAmount', minWidth: 100, align: 'center', enabledSort: false,
                    render: function (rowdata, index, value) {
                        return '&yen;' + FormatMoney(rowdata.penaltyAmount / 100);
                    }
                },
                {
                    display: '已还租金', name: 'payAmount', minWidth: 100, align: 'center', enabledSort: false,
                    render: function (rowdata, index, value) {
                        return '&yen;' + FormatMoney(rowdata.payAmount / 100);
                    }
                },
                {display: '还款率', name: 'paymentRate', minWidth: 100, align: 'center', enabledSort: false},
            ],
            usePager: false,
            root: 'rows',
            record: 'total',
            hideLoadButton: true,
            width: '100%',
            height: '100%',
            heightDiff: -2,
            allowUnSelectRow: true,
            alternatingRow: false,
            rownumbers: true,
            checkbox: false
        });
        grid.setHeight(100);

        //事业部
        $("#buOrgCd").ligerComboBox({
         valueField: 'key',
         textField: 'value'
         });
        $("#searchBar").ligerForm({
            validate: true
        });

        liger.get("buOrgCd").setData(${buOrgCdList});

        $("#pageloading").hide();

        /* 查询 */
        $("#searchBtn").click(function (event) {
            form = liger.get("searchBar");
            if (!form.valid()) {
                top.$.ligerDialog.SQalert({content: "请选择查询时间段", SQ_type: "warning"});
                return false; //验证不通过，不执行以下代码
            }
            var data = form.getData();
            for (name in data) {
                grid.setParm(name, data[name]);
            }
            grid.reload();
        });

        /* 清空 */
        $("#clearBtn").click(function (event) {
            clearLigerForm("searchBar");
        });

    });

</script>

</body>
</html>
